/*    */ package com.jcrj.util;
/*    */ 
/*    */ import java.util.Calendar;
/*    */ import java.util.Date;
/*    */ 
/*    */ public class DateArray
/*    */ {
/*    */   private int getMonthLastDay(Date date)
/*    */   {
/*  9 */     Calendar a = Calendar.getInstance();
/* 10 */     int year = date.getYear();
/* 11 */     int month = date.getMonth();
/* 12 */     a.set(1, year);
/* 13 */     a.set(2, month);
/* 14 */     a.set(5, 1);
/* 15 */     a.roll(5, -1);
/* 16 */     int maxDate = a.get(5);
/* 17 */     return maxDate;
/*    */   }
/*    */ 
/*    */   public Date[][] getAllDate(Date d) {
/* 21 */     Date[][] dates = new Date[6][7];
/* 22 */     Calendar c = Calendar.getInstance();
/* 23 */     c.setTime(d);
/* 24 */     c.set(5, 1);
/* 25 */     int amount = 1;
/* 26 */     for (int i = 0; i < dates.length; i++) {
/* 27 */       for (int j = 0; j < dates[i].length; j++) {
/* 28 */         if (amount == getMonthLastDay(d) + 1)
/*    */           break;
/* 30 */         int x = c.get(7) - 1;
/* 31 */         if (x == j) {
/* 32 */           dates[i][j] = c.getTime();
/* 33 */           c.roll(5, 1);
/* 34 */           amount++;
/*    */         }
/*    */       }
/*    */     }
/* 38 */     return dates;
/*    */   }
/*    */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.util.DateArray
 * JD-Core Version:    0.6.0
 */